<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HTML DOM - 改变 CSS</title>
    <script>
        function change() {
            let element = document.getElementById("h1");
            element.style.color = "#0006ff"
            element.style.border = "solid 1px red";
            element.style.fontSize = "100px";
        }

        var count = 0;
        function hideOrShow() {
            let element = document.getElementById("h1");
            let input = document.getElementById("hideOrShow");
            if (count % 2 == 0) {
                element.style.visibility = "hidden";
                input.value = "显示";
            } else {
                element.style.visibility = "visible"
                input.value = "隐藏";
            }
            count ++;
        }
    </script>
</head>
<body>

<h1 id="h1">babababababababababababababa</h1>
<button onclick="change()">请点击</button>
<input onclick="hideOrShow()" type="button" id="hideOrShow" value="隐藏"/>
</body>
</html>